package 第二章;

import java.util.Scanner;

public class 第一题 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入邮箱：");
        String email = input.next().trim();
        if (email.indexOf(".") != -1 && email.indexOf("@", 1) != -1 && email.indexOf(".") - email.indexOf("@") > 1) {
            System.out.println("邮箱合法！");
        } else {
            System.out.println("邮箱不合法！");
        }

    }
}
